From: Florian Müllner Date: Thu, 28 Jul 2011 18:06:24 +0000 (+0200) Subject: main: Add Main.notify() for simple system messages X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~7988 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=8bc85d4a79b0a503bf036e3a5460b9d25d4e53d2;p=gnome-shell.git main: Add Main.notify() for simple system messages ... similar to Main.notifyError(), but don't duplicate the message on stderr/in the log. https://bugzilla.gnome.org/show_bug.cgi?id=652718 --- diff --git a/js/ui/main.js b/js/ui/main.js index 195d3cbbe..5cde5410d 100644 --- a/js/ui/main.js +++ b/js/ui/main.js @@ -420,6 +420,19 @@ function loadTheme() { themeContext.set_theme (theme); } +/** + * notify: + * @msg: A message + * @details: Additional information + */ +function notify(msg, details) { + let source = new MessageTray.SystemNotificationSource(); + messageTray.add(source); + let notification = new MessageTray.Notification(source, msg, details); + notification.setTransient(true); + source.notify(notification); +} + /** * notifyError: * @msg: An error message @@ -434,11 +447,7 @@ function notifyError(msg, details) { else log("error: " + msg) - let source = new MessageTray.SystemNotificationSource(); - messageTray.add(source); - let notification = new MessageTray.Notification(source, msg, details); - notification.setTransient(true); - source.notify(notification); + notify(msg, details); } /**